
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix='fn' uri="http://java.sun.com/jsp/jstl/functions"%>


<%@ include file="../cabecalho.jsp"%>

<link href="<c:url value='/'/>/css/jquery-ui.css" rel="stylesheet"
	type="text/css" />
<script type="text/javascript" src="<c:url value='/'/>/js/gdl.js"></script>
<script language="javascript" type="text/javascript"
	src="<c:url value='/'/>/js/interface.js"></script>
<script language="javascript" type="text/javascript"
	src="<c:url value='/'/>/js/jquery-ui.js"></script>
<script language="javascript" type="text/javascript"
	src="<c:url value='/'/>/js/dateFormat.js"></script>

<script type="text/javascript">
	jQuery(function($) {
		$("input.data").mask("99/99/9999", {
			placeholder : ""
		});
	});
	jQuery(function($) {
		$("#ano").mask("9999", {
			placeholder : ""
		});
	});

	$(function() {
		$(".column").sortable({
			connectWith : '.column',
			handle : $(".portlet-header")
		});

		$(".portlet").addClass(
				"ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
				.find(".portlet-header").addClass(
						"ui-widget-header ui-corner-all").prepend(
						'<span class="ui-icon ui-icon-minusthick"></span>')
				.end().find(".portlet-content");

		$(".portlet-header .ui-icon").click(
				function() {
					$(this).toggleClass("ui-icon-minusthick").toggleClass(
							"ui-icon-plusthick");
					$(this).parents(".portlet:first").find(".tabelaDiv")
							.toggle();
				});

		/*$(".column").disableSelection();*/
		$.datepicker.setDefaults($.datepicker.regional['pt-BR']);
		$("#calendario").datepicker({
			maxDate : '+1m',
			onSelect : exibeAtividades
		});
	});

	function exibeAtividades(data) {

	}

	$.ajaxSetup({
		cache : false
	});
</script>

<script type="text/javascript">
	jQuery(function($) {
		$("#curriculo_view_link").live('click', function() {
			   	var spanHashUsuario = $(this).parent().find(">:first-child");							
				$.ajax(
				{		
					beforeSend: function(){
						$('#fundo').show();
						$('.carregando').show();
						$('#curriculo').html("");
						$('#curriculo').show();
		            },
					url: 'curriculoView/' + spanHashUsuario.html() ,
					success: function(data) {
					   	$('#curriculo').html(data);
					   	$('.carregando').hide();
					},
					error: function(txt){
			        	$('.carregando').html(txt);
					}
				});
		});
		
		$("#inscricao_view_link").live('click', function() {
		   	var spanHashUsuario = $(this).parent().find(">:first-child");							
			$.ajax(
			{
				beforeSend: function(){
					$('.carregando').show();
					$('#fundo').show();
					$('#curriculo').html("");
					$('#curriculo').show();
	            },
				url: 'inscricaoView/' + spanHashUsuario.html() ,
				success: function(data) {
					$('.carregando').hide();
				   	$('#curriculo').html(data);
				},
				error: function(txt){
		        	$('.carregando').html(txt);
				}
			});
		});
		$("#dados_pessoais_view_link").live('click', function() {
		   	var spanHashUsuario = $(this).parent().find(">:first-child");							
			$.ajax(
			{					
				beforeSend: function(){
					$('#curriculo').html("");
					$('.carregando').show();
					$('#curriculo').show();
					$('#fundo').show();
	            },
				url: 'dadosPessoaisView/' + spanHashUsuario.html() ,
				success: function(data) {
				   	$('#curriculo').html(data);
				   	$('.carregando').hide();
				},
				error: function(txt){
		        	$('.carregando').html(txt);
		        	$('#fundo').hide();
				}
			});
		});
		
		$('.fechar_modal').live('click', function(){
			$('#curriculo').hide();
			$('#fundo').hide();
		});
	});
	
</script>
<fieldset>
	<legend><fmt:message key="menu_visualizacao"/></legend>
	<div class="column" style="width: 100%">
	<ul>
		<li> <span style="display: none">${usuario.hash}</span> <a id="dados_pessoais_view_link" class="handCursor" > 
			<span class="visualiza"><fmt:message key="visualizacao_candidato_dados_pessoais"/></span></a>  
		</li>
		<li> <span style="display: none">${usuario.hash}</span> <a id="curriculo_view_link" class="handCursor"  > 
			<span class="visualiza"><fmt:message key="visualizacao_candidato_curriculo"/></span> </a>  
		</li>
		<li> <span style="display: none">${usuario.hash}</span> <a id="inscricao_view_link" class="handCursor" > 
			<span class="visualiza"><fmt:message key="visualizacao_candidato_curso_pretendido"/></span>  </a>  
		</li>
	</ul>	
	</div>
</fieldset>				

<div class="carregando modal">
	<fmt:message key="visualizacao_candidato_msg_aguarde"/>
</div>
<div id="curriculo" class="modal" >
	<!-- curriculoView.jsp sera carregado aqui -->
</div>
<div id="inscricao" class="modal" >
	<!-- inscricaoView.jsp sera carregado aqui -->
</div>					

<%@ include file="../rodape.jsp"%>

<div id="fundo"></div>